//
//  LzwIndexCollectCell.m
//  CoJellyCartoon
//
//  Created by 刘志武 on 16/4/5.
//  Copyright © 2016年 CJG. All rights reserved.
//

#import "LzwIndexCollectCell.h"
#import <Masonry.h>

@interface LzwIndexCollectCell ()

@property (nonatomic, strong) UIImageView *myImageView;
@property (nonatomic, strong) UILabel *lableTitle;

@end

@implementation LzwIndexCollectCell

-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        [self creatSubView];
    }
    
    return self;
}

- (void)creatSubView{
    
    self.myImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:self.myImageView];
    
    self.lableTitle = [[UILabel alloc]init];
    self.lableTitle.textAlignment = 1;
    [self.contentView addSubview:self.lableTitle];
    
    
    [self.myImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.left.equalTo(self.contentView).offset(0);
        make.width.equalTo(self.contentView);
        make.height.mas_equalTo(100);
        
        
    }];
    
    [self.lableTitle mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.myImageView.mas_bottom).offset(0);
        make.left.equalTo(self.contentView);
        make.width.equalTo(self.myImageView);
        make.height.mas_equalTo(20);
   
    }];
    
    
}

-(void)setModelIndex:(LzwIndexModle *)modelIndex{
    
    
    _modelIndex = modelIndex;
    
    
    NSURL *url = [NSURL URLWithString:_modelIndex.cover];
    [self.myImageView sd_setImageWithURL:url placeholderImage:nil];
    
    self.lableTitle.text = _modelIndex.tag_name;
 
    
}


@end
